<?php
define('IN_ECS', true);
require('../includes/init.php');
include_once('../comm.php');

$id = isset($_REQUEST['id'])?$_REQUEST['id']:'';
if($id == ''){
    echo '<root><error>Please input goods id.</error></root>';
    exit;
}
$pic = NewMagickWand();
//$sql1 = "select * from `fm_source` where typeid = '".$id."'"; 
$sql1 = "select * from ".$_table_goods_source." where goods_id = ".$id;
//$data = $dsql->fmSelect($sql1);
$data = $GLOBALS['db']->getAll($sql1);
$info = '';
foreach($data as $d){
	
	MagickReadImage ( $pic, '../'.$d['img_original'] );
	$h = MagickGetImageHeight($pic);
	$w = MagickGetImageWidth($pic);
	
	$info .= "<info>
	<name>".$d['img_desc']."</name>
	<urlx>/".$d['img_original']."</urlx>
	<width>".$w."</width>
	<height>".$h."</height>
	<idx>".$d['img_id']."</idx>
	<thumb>/".$d['thumb_url']."</thumb>
	<goods_id>".$d['goods_id']."</goods_id>
	<hot>".$d['hotarea']."</hot>
	</info>";
}
	
$info = '<root>'.$info.'</root>';

echo $info;
?>